import { ImageName } from "./ImageLoader";

export type DrawSize = [number, number] | [number, number, number, number];

/**
 * 图片可见度
 *
 * 1.true 显示
 *
 * 2.false 不显示
 *
 * 3.number[0-1] 透明度
*/
export type ImageVisibility = boolean | number;

/**
 * 图片播放状态
 *
 * 1."first" 只绘制第一帧
 *
 * 2."run" 播放动画
 *
 * 3.number 绘制某一帧
*/
export type ImageState = "first" | "run" | number;

export const eventTypeList = [
	["stop", "禁止通行"],
	["seal", "被封印"],

	["battle", "战斗"],
	["consume", "消耗触发"],
	["get", "被获取"],
	["remove", "触碰删除"],
	["prop", "道具触发"],
	["up", "上楼梯"],
	["down", "下楼梯"],
	["store", "打开商店"],

	["event", "触发事件"],
] as const;

export type EventType = typeof eventTypeList[number][0];

export type EventListType = Set<EventType> | undefined;

/**
 * 单位信息
 * [0:单位名称,1:是否显示,2:绘制大小,3:图像状态,4:触发类型列表]
 */
export type UnitInfo = [ImageName, ImageVisibility, DrawSize, ImageState, EventListType?];

export type MapFloor = number;

export type MapInfo = {
	floor: MapFloor;
	name: string;
	unit: Set<UnitInfo>;
};

const theMap: MapInfo[] = [
	{
		floor: 1,
		name: "主塔一层",
		unit: new Set<UnitInfo>([
			["闪星星", true, [0, 0, 10, 10], "run"],
			["石地板", true, [5, 0, 5, 10], "first"],
			["石地板", true, [4, 3, 6, 5], "first"],
			["石墙", true, [4, 0, 4, 2], "first", new Set<EventType>(["stop"])],
			["石墙", true, [6, 0, 6, 2], "first", new Set<EventType>(["stop"])],
			["石墙", true, [3, 2, 3, 6], "first", new Set<EventType>(["stop"])],
			["石墙", true, [7, 2, 7, 6], "first", new Set<EventType>(["stop"])],
			["石墙", true, [4, 6, 4, 10], "first", new Set<EventType>(["stop"])],
			["石墙", true, [6, 6, 6, 10], "first", new Set<EventType>(["stop"])],
			["楼梯上", true, [5, 0], "run", new Set<EventType>(["up"])],
			["绿史莱姆", true, [5, 1], "run", new Set<EventType>(["battle"])],
			["青门", true, [5, 2], "first", new Set<EventType>(["seal"])],
			["仙子", true, [5, 4], "run", new Set<EventType>(["event"])],
			["红钥匙", false, [6, 3], "run", new Set<EventType>(["get"])],
			["楼梯下", false, [5, 10], "run"],
		]),
	}, {
		floor: 2,
		name: "主塔二层",
		unit: new Set<UnitInfo>([
			["石地板", true, [0, 0, 10, 10], "run"],
			["石墙", true, [0, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [2, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [2, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 0, 3, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 0, 7, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 2, 9, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 4, 8, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 5, 2, 5], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 5], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 5, 5, 9], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 7, 3, 9], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 9], "run", new Set<EventType>(["stop"])],
			["石墙", true, [1, 6, 1, 9], "run", new Set<EventType>(["stop"])],
			["隐藏石墙", true, [2, 9], "first", new Set<EventType>(["remove"])],
			["石墙", true, [10, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [8, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 6, 7, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [8, 8], "run", new Set<EventType>(["stop"])],
			["石墙", true, [10, 8], "run", new Set<EventType>(["stop"])],
			["楼梯上", true, [0, 6], "run", new Set<EventType>(["up"])],
			["楼梯下", true, [5, 0], "run", new Set<EventType>(["down"])],
			["老人", true, [0, 4], "run", new Set<EventType>(["event", "remove"])],
			["红门", true, [5, 2], "first", new Set<EventType>(["consume"])],
			["青门", false, [7, 3], "first", new Set<EventType>(["seal"])],
			["青门", true, [9, 8], "first", new Set<EventType>(["seal"])],
			["黄门", true, [1, 3], "first", new Set<EventType>(["consume"])],
			["黄门", true, [10, 2], "first", new Set<EventType>(["consume"])],
			["黄门", true, [9, 6], "first", new Set<EventType>(["consume"])],
			["蓝门", true, [3, 5], "first", new Set<EventType>(["consume"])],
			["红宝石", true, [0, 0], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [2, 0], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [0, 2], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [2, 2], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [8, 0], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [9, 0], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [10, 0], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [8, 1], "run", new Set<EventType>(["get", "event"])],
			["大血瓶", true, [9, 1], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [1, 4], "run", new Set<EventType>(["get"])],
			["蓝钥匙", true, [10, 4], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [9, 5], "run", new Set<EventType>(["get"])],
			["红宝石", true, [10, 5], "run", new Set<EventType>(["get"])],
			["蓝钥匙", true, [2, 7], "run", new Set<EventType>(["get"])],
			["蓝钥匙", true, [4, 7], "run", new Set<EventType>(["get"])],
			["红宝石", true, [2, 8], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [4, 8], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [6, 8], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [0, 8], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [8, 9], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [10, 9], "run", new Set<EventType>(["get"])],
			["铁盾", true, [9, 10], "run", new Set<EventType>(["get"])],
			["小蝙蝠", true, [1, 0], "run", new Set<EventType>(["battle"])],
			["初级法师", true, [1, 1], "run", new Set<EventType>(["battle"])],
			["小蝙蝠", true, [1, 2], "run", new Set<EventType>(["battle"])],
			["骷髅武士", true, [10, 1], "run", new Set<EventType>(["battle", "event"])],
			["小蝙蝠", true, [8, 3], "run", new Set<EventType>(["battle"])],
			["红史莱姆", true, [2, 4], "run", new Set<EventType>(["battle"])],
			["大蝙蝠", true, [3, 6], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [7, 5], "run", new Set<EventType>(["battle"])],
			["初级卫兵", true, [8, 7], "run", new Set<EventType>(["battle", "event"])],
			["初级卫兵", true, [10, 7], "run", new Set<EventType>(["battle", "event"])],
			["绿史莱姆", true, [6, 7], "run", new Set<EventType>(["battle"])],
			["绿史莱姆", true, [4, 10], "run", new Set<EventType>(["battle"])],
			["红史莱姆", true, [3, 10], "run", new Set<EventType>(["battle"])],
			["绿史莱姆", true, [2, 10], "run", new Set<EventType>(["battle"])]
		]),
	}, {
		floor: 3,
		name: "主塔三层",
		unit: new Set<UnitInfo>([
			["石地板", true, [0, 0, 10, 10], "run"],
			["石墙", true, [1, 1, 2, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 1, 9, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 0], "run", new Set<EventType>(["stop"])],
			["石墙", true, [2, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 4, 3, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [8, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 4, 10, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 4, 5, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 9], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 6, 1, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 6, 3, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 6, 7, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 6, 10, 6], "run", new Set<EventType>(["stop"])],
			["楼梯上", true, [10, 5], "run", new Set<EventType>(["up"])],
			["楼梯下", true, [0, 5], "run", new Set<EventType>(["down"])],
			["商店1_1", true, [4, 2], "run", new Set<EventType>(["stop"])],
			["贪婪之神", true, [5, 2], "run", new Set<EventType>(["store"])],
			["商店1_3", true, [6, 2], "run", new Set<EventType>(["stop"])],
			["奸商", true, [0, 10], "run", new Set<EventType>(["event", "remove"])],
			["小偷", true, [10, 10], "run", new Set<EventType>(["event", "remove"])],
			["隐藏石墙", true, [3, 1], "first", new Set<EventType>(["remove"])],
			["隐藏石墙", true, [5, 8], "first", new Set<EventType>(["remove"])],
			["蓝门", true, [0, 1], "first", new Set<EventType>(["consume"])],
			["蓝门", true, [10, 1], "first", new Set<EventType>(["consume"])],
			["黄门", true, [2, 2], "first", new Set<EventType>(["consume"])],
			["黄门", true, [8, 2], "first", new Set<EventType>(["consume"])],
			["黄门", true, [4, 4], "first", new Set<EventType>(["consume"])],
			["蓝门", true, [6, 4], "first", new Set<EventType>(["consume"])],
			["铁门", true, [2, 6], "first", new Set<EventType>(["consume"])],
			["铁门", true, [8, 6], "first", new Set<EventType>(["consume"])],
			["铁剑", true, [4, 0], "run", new Set<EventType>(["get"])],
			["奇怪的权杖", true, [6, 0], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [0, 2], "run", new Set<EventType>(["get"])],
			["蓝钥匙", true, [1, 3], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [10, 2], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [9, 3], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [4, 6], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [6, 6], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [4, 7], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [6, 7], "run", new Set<EventType>(["get"])],
			["红宝石", true, [0, 9], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [1, 10], "run", new Set<EventType>(["get"])],
			["蓝钥匙", true, [10, 9], "run", new Set<EventType>(["get"])],
			["红钥匙", true, [9, 10], "run", new Set<EventType>(["get"])],
			["骷髅武士", true, [2, 0], "run", new Set<EventType>(["battle"])],
			["骷髅武士", true, [8, 0], "run", new Set<EventType>(["battle"])],
			["初级法师", true, [1, 2], "run", new Set<EventType>(["battle"])],
			["初级法师", true, [9, 2], "run", new Set<EventType>(["battle"])],
			["红史莱姆", true, [5, 3], "run", new Set<EventType>(["battle"])],
			["黑史莱姆", true, [4, 8], "run", new Set<EventType>(["battle"])],
			["黑史莱姆", true, [6, 8], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [5, 10], "run", new Set<EventType>(["battle"])],
			["红蝙蝠", true, [2, 7], "run", new Set<EventType>(["battle"])],
			["红蝙蝠", true, [8, 7], "run", new Set<EventType>(["battle"])]
		]),
	}, {
		floor: 4,
		name: "主塔四层",
		unit: new Set<UnitInfo>([
			["石地板", true, [0, 0, 10, 10], "run", new Set<EventType>([])],
			["石墙", true, [0, 1, 0, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [1, 0, 3, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 0, 7, 2], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 0, 9, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 5, 9, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [10, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [2, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [2, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 4, 3, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 4, 7, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 5, 7, 8], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 7, 5, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 8], "run", new Set<EventType>(["stop"])],
			["石墙", true, [5, 10], "run", new Set<EventType>(["stop"])],
			["楼梯上", true, [8, 0], "run", new Set<EventType>(["up"])],
			["楼梯下", true, [9, 9], "run", new Set<EventType>(["down"])],
			["老人", true, [5, 0], "run", new Set<EventType>(["store"])],
			["隐藏石墙", true, [6, 2], "first", new Set<EventType>(["remove"])],
			["黄门", true, [1, 4], "first", new Set<EventType>(["consume"])],
			["黄门", true, [4, 4], "first", new Set<EventType>(["consume"])],
			["蓝门", true, [9, 4], "first", new Set<EventType>(["consume"])],
			["青门", true, [1, 7], "first", new Set<EventType>(["seal"])],
			["蓝门", true, [8, 7], "first", new Set<EventType>(["consume"])],
			["蓝门", true, [5, 9], "first", new Set<EventType>(["consume"])],
			["黄门", true, [7, 9], "first", new Set<EventType>(["consume"])],
			["黄钥匙", true, [4, 1], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [6, 1], "run", new Set<EventType>(["get"])],
			["红宝石", true, [10, 0], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [10, 6], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [6, 5], "run", new Set<EventType>(["get"])],
			["红宝石", true, [5, 6], "run", new Set<EventType>(["get"])],
			["蓝宝石", true, [0, 3], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [4, 8], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [4, 10], "run", new Set<EventType>(["get"])],
			["大血瓶", true, [6, 10], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [0, 10], "run", new Set<EventType>(["get"])],
			["小血瓶", true, [2, 10], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [0, 8], "run", new Set<EventType>(["get"])],
			["黄钥匙", true, [2, 8], "run", new Set<EventType>(["get"])],
			["红钥匙", true, [1, 9], "run", new Set<EventType>(["get"])],
			["兽人", true, [5, 2], "run", new Set<EventType>(["battle"])],
			["骷髅武士", true, [3, 3], "run", new Set<EventType>(["battle"])],
			["骷髅武士", true, [8, 2], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [10, 1], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [10, 2], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [10, 3], "run", new Set<EventType>(["battle"])],
			["初级法师", true, [10, 5], "run", new Set<EventType>(["battle"])],
			["初级法师", true, [8, 5], "run", new Set<EventType>(["battle"])],
			["黑史莱姆", true, [8, 6], "run", new Set<EventType>(["battle"])],
			["大蝙蝠", true, [4, 5], "run", new Set<EventType>(["battle"])],
			["骷髅人", true, [6, 7], "run", new Set<EventType>(["battle"])],
			["黑史莱姆", true, [6, 9], "run", new Set<EventType>(["battle"])],
			["小蝙蝠", true, [4, 9], "run", new Set<EventType>(["battle"])],
			["初级卫兵", true, [1, 5], "run", new Set<EventType>(["battle", "event"])],
			["初级卫兵", true, [0, 6], "run", new Set<EventType>(["battle", "event"])],
			["初级卫兵", true, [2, 6], "run", new Set<EventType>(["battle", "event"])]
		]),
	}, {
		floor: 5,
		name: "主塔五层",
		unit: new Set<UnitInfo>([
			["石地板", true, [0, 0, 10, 10], "run"],
			["楼梯上", true, [5, 0], "run", new Set<EventType>(["up"])],
			["楼梯下", true, [5, 10], "run", new Set<EventType>(["down"])],
			["石墙", true, [0, 0, 3, 0], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 0, 4, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 3, 4, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 4, 1, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 1, 0, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 0, 6, 1], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 0, 10, 0], "run", new Set<EventType>(["stop"])],
			["石墙", true, [10, 1, 10, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 4, 7, 4], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 3], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 6, 1, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [3, 6, 4, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [4, 9, 4, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [0, 7, 0, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [1, 10, 3, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 6, 7, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 7], "run", new Set<EventType>(["stop"])],
			["石墙", true, [9, 6, 10, 6], "run", new Set<EventType>(["stop"])],
			["石墙", true, [10, 7, 10, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [6, 9, 6, 10], "run", new Set<EventType>(["stop"])],
			["石墙", true, [7, 10, 9, 10], "run", new Set<EventType>(["stop"])],
			["红门", true, [5, 7], "first", new Set<EventType>(["consume", "event"])],
			["青门", true, [4, 2], "first", new Set<EventType>(["seal"])],
			["青门", true, [2, 4], "first", new Set<EventType>(["seal"])],
			["青门", true, [6, 2], "first", new Set<EventType>(["seal"])],
			["青门", true, [8, 4], "first", new Set<EventType>(["seal"])],
			["青门", true, [8, 6], "first", new Set<EventType>(["seal"])],
			["青门", true, [6, 8], "first", new Set<EventType>(["seal"])],
			["青门", true, [4, 8], "first", new Set<EventType>(["seal"])],
			["青门", true, [2, 6], "first", new Set<EventType>(["seal"])],
			["青门", false, [5, 9], "first", new Set<EventType>(["seal"])],
			["青门", false, [5, 1], "first", new Set<EventType>(["seal"])],
			["青门", false, [5, 4], "first", new Set<EventType>(["seal"])],
			["青门", false, [5, 6], "first", new Set<EventType>(["seal"])],
			["青门", false, [4, 5], "first", new Set<EventType>(["seal"])],
			["青门", false, [6, 5], "first", new Set<EventType>(["seal"])],
			["黄钥匙", false, [1, 1], "run", new Set<EventType>(["get"])],
			["黄钥匙", false, [3, 1], "run", new Set<EventType>(["get"])],
			["黄钥匙", false, [1, 3], "run", new Set<EventType>(["get"])],
			["黄钥匙", false, [3, 3], "run", new Set<EventType>(["get"])],
			["蓝钥匙", false, [2, 2], "run", new Set<EventType>(["get"])],
			["红宝石", false, [7, 1], "run", new Set<EventType>(["get"])],
			["红宝石", false, [9, 1], "run", new Set<EventType>(["get"])],
			["红宝石", false, [8, 2], "run", new Set<EventType>(["get"])],
			["红宝石", false, [7, 3], "run", new Set<EventType>(["get"])],
			["红宝石", false, [9, 3], "run", new Set<EventType>(["get"])],
			["蓝宝石", false, [1, 7], "run", new Set<EventType>(["get"])],
			["蓝宝石", false, [3, 7], "run", new Set<EventType>(["get"])],
			["蓝宝石", false, [2, 8], "run", new Set<EventType>(["get"])],
			["蓝宝石", false, [1, 9], "run", new Set<EventType>(["get"])],
			["蓝宝石", false, [3, 9], "run", new Set<EventType>(["get"])],
			["小血瓶", false, [7, 7], "run", new Set<EventType>(["get"])],
			["小血瓶", false, [9, 7], "run", new Set<EventType>(["get"])],
			["小血瓶", false, [7, 9], "run", new Set<EventType>(["get"])],
			["小血瓶", false, [9, 9], "run", new Set<EventType>(["get"])],
			["大血瓶", false, [8, 8], "run", new Set<EventType>(["get"])],
			["骷髅队长", false, [5, 5], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [1, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [2, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [3, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [1, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [2, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [3, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [1, 3], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [2, 3], "run", new Set<EventType>(["battle", "event"])],
			["骷髅武士", true, [3, 3], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [7, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [8, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [9, 1], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [7, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [8, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [9, 2], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [7, 3], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [8, 3], "run", new Set<EventType>(["battle", "event"])],
			["骷髅人", true, [9, 3], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [1, 7], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [2, 7], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [3, 7], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [1, 8], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [2, 8], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [3, 8], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [2, 9], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [1, 9], "run", new Set<EventType>(["battle", "event"])],
			["初级法师", true, [3, 9], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [7, 7], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [8, 7], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [9, 7], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [7, 8], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [8, 8], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [9, 8], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [7, 9], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [8, 9], "run", new Set<EventType>(["battle", "event"])],
			["大蝙蝠", true, [9, 9], "run", new Set<EventType>(["battle", "event"])],
		]),
	},
];

export function ParsrEventInfo(event: EventListType) {
	return event = event === undefined ? undefined : new Set(Array.from(event))
}

export function ParsrFloorInfo({ floor, name, unit }: MapInfo): MapInfo {
	return {
		floor,
		name,
		unit: new Set(Array.from(unit).map(([image, show, pos, state, event]) => {
			return [image, show, pos, state, ParsrEventInfo(event)];
		}))
	};
}

const parseMap = new Map(theMap.map(info => [info.floor, ParsrFloorInfo(info)]));

export function GetAllMap() {
	return new Map(Array.from(parseMap).map(([floor, info]) => [floor, ParsrFloorInfo(info)]));
};

export function GetMap(floor: MapFloor) {
	return parseMap.get(floor)
};

export function GetFloorList() {
	return theMap.map(info => info.floor);
};

export function GetMapAll() {
	return theMap;
};
